<?php

/**
 * sfGuardUser form.
 *
 * @package    SdCommerce
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrinePluginFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class sfGuardUserForm extends PluginsfGuardUserForm
{
  public function configure()
  {
      unset($this['created_at'], $this['updated_at']);
      $this->widgetSchema['permissions_list']->setOption('renderer_class', 'sfWidgetFormSelectDoubleList');
      $this->validatorSchema['username'] = new sfValidatorString(array('max_length' => 255, 'required' => TRUE));

        $this->widgetSchema['password'] = new sfWidgetFormInputPassword();
        $this->validatorSchema['password'] = new sfValidatorString(array('max_length' => 255, 'min_length' => 6, 'required' => TRUE));

        $this->widgetSchema['first_name'] = new sfWidgetFormInputText();
        $this->validatorSchema['first_name'] = new sfValidatorString(array('max_length' => 255, 'min_length' => 3, 'required' => TRUE));
        $this->widgetSchema['last_name'] = new sfWidgetFormInputText();
        $this->validatorSchema['last_name'] = new sfValidatorString(array('max_length' => 255, 'min_length' => 3, 'required' => TRUE));

        $this->widgetSchema['email_address'] = new sfWidgetFormInputText();
        $this->validatorSchema['email_address'] = new sfValidatorString(array('max_length' => 70, 'required' => TRUE));
        $this->validatorSchema['code'] = new sfValidatorString(array('max_length' => 70, 'required' => 'Ce champ est requis.'));
        $this->widgetSchema->setLabels(array(
            'last_name' => 'Prénom',
            'first_name' => 'Nom',
            'email_address' => 'Adresse Email',
            'departement_id' => 'Departement',
            'password' => 'Mot de passe',
            'username' => 'Pseudo',
        ));
        gfFormHelper::addRequiredToLabel($this);
        gfFormHelper::addValidateOption($this);
  }
}
